<%= form_for([:admin, @studio], html: { multipart: true}) do |f| %>
  <%= hidden_field_tag :company_name, params[:company_name] %>
  <div>
    <div id='studios_table'>
      <span>分店名称</span>
      <span><%= f.text_field :name, :required => true, :style =>"width:10em" %></span>
      <span>购买年限</span>
      <span><%= number_field_tag :duration, '', :required => true, :style =>"width:10em" %></span>
    </div>
    <span><%= link_to '增加分店','javascript:void(0)',:id =>'add_studio' %></span>
  </div>
  </br>
  <div>
    
  </div>
  </br>
  <div>
      <%= link_to '取消', admin_companies_path %>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
      <%= f.submit "立即支付" %>
      <p align='left'><%= link_to '支付,支付宝支付', action: "index" ,controller: 'shop_detail' %></p>
  </div>
<% end %>

<script>
//增加分店
$('#add_studio').click(function(){
  $('#studios_table').
    append('<div><span>分店名称</span><input id="studio_name_tag" required=true type="text" name=studios_name[] /><span>购买年限</span><input id="studio_duration_tag" required=true type="number" name=studios_duration[] /><span class="remove_tag" id="removeTag">删除</span></div>');
    $(".remove_tag").click(function() {
      $(this).parent().remove();
    });
});
</script>



